package com.college.express;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.college.express.activity.PersonalActivity;
import com.college.express.activity.TaskListActivity;
import com.college.express.base.BaseActivity;

public class MainActivity extends BaseActivity {

  private TextView mTvExpressList;
  private TextView mTvSendOut;
  private TextView mTvAgency;
  private TextView mTvPersonal;


  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    initView();
  }

  @Override
  protected boolean showTitle() {
    return true;
  }

  @Override
  protected String setTitle() {
    return "测试Demo";
  }

  @Override
  protected boolean showBack() {
    return false;
  }


  @Override
  protected void initView() {


    mTvExpressList = (TextView) findViewById(R.id.tv_express_list);
    mTvExpressList.setOnClickListener(this);
    mTvSendOut = (TextView) findViewById(R.id.tv_send_out);
    mTvSendOut.setOnClickListener(this);
    mTvAgency = (TextView) findViewById(R.id.tv_agency);
    mTvAgency.setOnClickListener(this);
    mTvPersonal = (TextView) findViewById(R.id.tv_personal);
    mTvPersonal.setOnClickListener(this);
  }

  @Override
  protected void initData() {

  }


  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.tv_express_list:
        openTasKListPage("1");
        break;
      case R.id.tv_send_out:
        openTasKListPage("2");
        break;
      case R.id.tv_agency:
        openTasKListPage("3");
        break;
      case R.id.tv_personal:
        startActivity(new Intent(this, PersonalActivity.class));
        break;
      default:
        break;
    }
  }

  private void openTasKListPage(String flag) {
    Intent intent = new Intent(this, TaskListActivity.class);
    intent.putExtra("flag", flag);
    startActivity(intent);
  }
}